Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce HPy_Type and tentatively HPy_TypeCheck #161

Merged
merged 4 commits into from
Jan 28, 2021
Merged

Conversation

antocuni
Copy link
Collaborator

HPy_Type is smooth, but the precise semantics of HPy_TypeCheck are still to be decided, see #160:
this PR tentatively implements solution (2): do the check but raise a fatal error instead of a proper exception.

I need both functions to progress with PR #142, that's why I opened a PR before we reached consensus on how to solve the issue. I propose to merge it as is, and revisit the semantics and/or change the name later when we make a decision.

Copy link
Contributor

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@hodgestar
Copy link
Contributor

@antocuni The infer test is failing here too. I am checking why.

@hodgestar
Copy link
Contributor

hodgestar commented Jan 28, 2021

From infer:

Found 1 issue

hpy/devel/src/runtime/ctx_object.c:35: error: NULL_DEREFERENCE
  pointer `type` last assigned on line 34 could be null and is dereferenced at line 35, column 10.
  33.   {
  34.       PyObject *type= _h2py(h_type);
  35. >     if (!PyType_Check(type)) {
  36.           Py_FatalError("HPy_TypeCheck arg 2 must be a type");
  37.       }

@antocuni antocuni merged commit 0840d63 into master Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants